{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "G6KZikFEZAWa",
        "outputId": "584022f6-4f24-4717-d99d-bba3a45b957e"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Mounted at /content/drive\n"
          ]
        }
      ],
      "source": [
        "from google.colab import drive\n",
        "drive.mount('/content/drive')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "wcn8srREaUQS"
      },
      "source": [
        "# **Описание датасета**\n",
        "Этот набор данных представляет собой список миллиардеров и компаний Forbes 2022 года. Датасет включает в себя место в рейтинге, имя и некоторую специальную информацию о человеке. В датасет включены 2667 записей.\n",
        "\n",
        "# **Задание 1**\n",
        "Вывод выбранного датасета. В нем присутствуют пропущенные данные и категориальные признаки: категория, страна, штат, город, пол. "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "uDqncBxcZjOl",
        "outputId": "77a3f02f-d8cf-49b2-b698-0947e93a1bd6"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "  <div id=\"df-2828537a-cc11-4585-abb1-b0c10c926bbe\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Место</th>\n",
              "      <th>Имя</th>\n",
              "      <th>Возраст</th>\n",
              "      <th>Состояние</th>\n",
              "      <th>Категория</th>\n",
              "      <th>Источник</th>\n",
              "      <th>Страна</th>\n",
              "      <th>Штат</th>\n",
              "      <th>Город</th>\n",
              "      <th>Организация</th>\n",
              "      <th>Selfmade</th>\n",
              "      <th>Пол</th>\n",
              "      <th>Дата рождения</th>\n",
              "      <th>Титул</th>\n",
              "      <th>Оценка благотворительности</th>\n",
              "      <th>Биография</th>\n",
              "      <th>О человеке</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>50.00</td>\n",
              "      <td>219000</td>\n",
              "      <td>Automotive</td>\n",
              "      <td>Tesla, SpaceX</td>\n",
              "      <td>United States</td>\n",
              "      <td>Texas</td>\n",
              "      <td>Austin</td>\n",
              "      <td>Tesla</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>6/28/1971</td>\n",
              "      <td>CEO</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.</td>\n",
              "      <td>Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Jeff Bezos</td>\n",
              "      <td>58.00</td>\n",
              "      <td>171000</td>\n",
              "      <td>Technology</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>United States</td>\n",
              "      <td>Washington</td>\n",
              "      <td>Seattle</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>1/12/1964</td>\n",
              "      <td>Entrepreneur</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.</td>\n",
              "      <td>Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "      <td>Bernard Arnault &amp; family</td>\n",
              "      <td>73.00</td>\n",
              "      <td>158000</td>\n",
              "      <td>Fashion &amp; Retail</td>\n",
              "      <td>LVMH</td>\n",
              "      <td>France</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Paris</td>\n",
              "      <td>LVMH Moët Hennessy Louis Vuitton</td>\n",
              "      <td>False</td>\n",
              "      <td>M</td>\n",
              "      <td>3/5/1949</td>\n",
              "      <td>Chairman and CEO</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Bernard Arnault oversees the LVMH empire of some 70 fashion and cosmetics brands, including Louis Vuitton and Sephora.\\nIn January 2021, LVMH acquired American jeweler Tiffany &amp; Co for $15.8 billion, believed to be the biggest luxury brand acquisition ever.\\nLVMH spent $3.2 billion in 2019 for luxury hospitality group Belmond, which owns or manages 46 hotels, trains and river cruises.\\nHis father made a small fortune in construction; Arnault got his start by putting up $15 million from that business to buy Christian Dior in 1985.\\nFour of Arnault's five children work in corners of the LVMH empire: Frédéric, Delphine, Antoine and Alexandre.</td>\n",
              "      <td>Arnault apparently wooed his wife, Helene Mercier, a concert pianist, by playing Chopin and other classical composers on the piano.\\nEvery Saturday, Arnault visits as many as 25 stores -- including both his and those of his competitors.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2665</th>\n",
              "      <td>2578</td>\n",
              "      <td>Wen Zhou &amp; family</td>\n",
              "      <td>57.00</td>\n",
              "      <td>1000</td>\n",
              "      <td>Manufacturing</td>\n",
              "      <td>chemicals</td>\n",
              "      <td>China</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Shanghai</td>\n",
              "      <td>NaN</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>3/6/1965</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Zhou Wen chairs Shanghai Pret Composites, a supplier of plastics and composites.</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2666</th>\n",
              "      <td>2578</td>\n",
              "      <td>Zhou Yifeng &amp; family</td>\n",
              "      <td>43.00</td>\n",
              "      <td>1000</td>\n",
              "      <td>Energy</td>\n",
              "      <td>liquefied petroleum gas</td>\n",
              "      <td>China</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Zhangjiagang</td>\n",
              "      <td>NaN</td>\n",
              "      <td>True</td>\n",
              "      <td>F</td>\n",
              "      <td>7/11/1978</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Zhou Yifeng chairs Shenzhen-listed Oriental Energy Co., which imports and distributes liquefied petroleum gas.\\nZhou holds degrees from the Beijing University of Traditional Chinese Medicine and the Nanjing University of Science and Technology.</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2667</th>\n",
              "      <td>2578</td>\n",
              "      <td>Zhuang Kuilong &amp; family</td>\n",
              "      <td>59.00</td>\n",
              "      <td>1000</td>\n",
              "      <td>Manufacturing</td>\n",
              "      <td>polyester</td>\n",
              "      <td>China</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Jiaxing</td>\n",
              "      <td>NaN</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>6/15/1962</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>Zhuang Kuilong chairs Xinfengming Group, a manufacturer of polyester and filament products.\\nZhuang was reportedly a farmer before a joining a collective fiber factory.\\nZhuang cofounded the predecessor business of Xinfengming in 2000 with 11 others including his wife Qu Fengqi.\\nXinfengming listed on Shanghai Stock Exchange in April 2017.\\nSon Zhuang Yaozhong is the company's president.</td>\n",
              "      <td>NaN</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>2668 rows × 17 columns</p>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-2828537a-cc11-4585-abb1-b0c10c926bbe')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-2828537a-cc11-4585-abb1-b0c10c926bbe button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-2828537a-cc11-4585-abb1-b0c10c926bbe');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ],
            "text/plain": [
              "      Место                       Имя  Возраст  Состояние         Категория  \\\n",
              "0         1                 Elon Musk    50.00     219000        Automotive   \n",
              "1         2                Jeff Bezos    58.00     171000        Technology   \n",
              "2         3  Bernard Arnault & family    73.00     158000  Fashion & Retail   \n",
              "...     ...                       ...      ...        ...               ...   \n",
              "2665   2578         Wen Zhou & family    57.00       1000     Manufacturing   \n",
              "2666   2578      Zhou Yifeng & family    43.00       1000            Energy   \n",
              "2667   2578   Zhuang Kuilong & family    59.00       1000     Manufacturing   \n",
              "\n",
              "                     Источник         Страна        Штат         Город  \\\n",
              "0               Tesla, SpaceX  United States       Texas        Austin   \n",
              "1                      Amazon  United States  Washington       Seattle   \n",
              "2                        LVMH         France         NaN         Paris   \n",
              "...                       ...            ...         ...           ...   \n",
              "2665                chemicals          China         NaN      Shanghai   \n",
              "2666  liquefied petroleum gas          China         NaN  Zhangjiagang   \n",
              "2667                polyester          China         NaN       Jiaxing   \n",
              "\n",
              "                           Организация  Selfmade Пол Дата рождения  \\\n",
              "0                                Tesla      True   M     6/28/1971   \n",
              "1                               Amazon      True   M     1/12/1964   \n",
              "2     LVMH Moët Hennessy Louis Vuitton     False   M      3/5/1949   \n",
              "...                                ...       ...  ..           ...   \n",
              "2665                               NaN      True   M      3/6/1965   \n",
              "2666                               NaN      True   F     7/11/1978   \n",
              "2667                               NaN      True   M     6/15/1962   \n",
              "\n",
              "                 Титул  Оценка благотворительности  \\\n",
              "0                  CEO                        1.00   \n",
              "1         Entrepreneur                        1.00   \n",
              "2     Chairman and CEO                         NaN   \n",
              "...                ...                         ...   \n",
              "2665               NaN                         NaN   \n",
              "2666               NaN                         NaN   \n",
              "2667               NaN                         NaN   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Биография  \\\n",
              "0              Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.   \n",
              "1     Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.   \n",
              "2                                                       Bernard Arnault oversees the LVMH empire of some 70 fashion and cosmetics brands, including Louis Vuitton and Sephora.\\nIn January 2021, LVMH acquired American jeweler Tiffany & Co for $15.8 billion, believed to be the biggest luxury brand acquisition ever.\\nLVMH spent $3.2 billion in 2019 for luxury hospitality group Belmond, which owns or manages 46 hotels, trains and river cruises.\\nHis father made a small fortune in construction; Arnault got his start by putting up $15 million from that business to buy Christian Dior in 1985.\\nFour of Arnault's five children work in corners of the LVMH empire: Frédéric, Delphine, Antoine and Alexandre.   \n",
              "...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ...   \n",
              "2665                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Zhou Wen chairs Shanghai Pret Composites, a supplier of plastics and composites.   \n",
              "2666                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Zhou Yifeng chairs Shenzhen-listed Oriental Energy Co., which imports and distributes liquefied petroleum gas.\\nZhou holds degrees from the Beijing University of Traditional Chinese Medicine and the Nanjing University of Science and Technology.   \n",
              "2667                                                                                                                                                                                                                                                                                                                     Zhuang Kuilong chairs Xinfengming Group, a manufacturer of polyester and filament products.\\nZhuang was reportedly a farmer before a joining a collective fiber factory.\\nZhuang cofounded the predecessor business of Xinfengming in 2000 with 11 others including his wife Qu Fengqi.\\nXinfengming listed on Shanghai Stock Exchange in April 2017.\\nSon Zhuang Yaozhong is the company's president.   \n",
              "\n",
              "                                                                                                                                                                                                                                                              О человеке  \n",
              "0                                             Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.   \n",
              "1     Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.  \n",
              "2                           Arnault apparently wooed his wife, Helene Mercier, a concert pianist, by playing Chopin and other classical composers on the piano.\\nEvery Saturday, Arnault visits as many as 25 stores -- including both his and those of his competitors.  \n",
              "...                                                                                                                                                                                                                                                                  ...  \n",
              "2665                                                                                                                                                                                                                                                                 NaN  \n",
              "2666                                                                                                                                                                                                                                                                 NaN  \n",
              "2667                                                                                                                                                                                                                                                                 NaN  \n",
              "\n",
              "[2668 rows x 17 columns]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "\n",
        "filename = '/content/drive/My Drive/Dataset/forbes_billionaires_2022.csv'\n",
        "ds = pd.read_csv(filename)\n",
        "pd.set_option('max_rows', 6)\n",
        "\n",
        "pd.set_option('display.max_colwidth', None)\n",
        "pd.set_option('display.float_format', '{:.2f}'.format)\n",
        "ds.columns = ['Место', 'Имя', 'Возраст' , 'Состояние', 'Категория', 'Источник', 'Страна', 'Штат', 'Город', 'Организация', 'Selfmade', 'Пол', 'Дата рождения', 'Титул', 'Оценка благотворительности', 'Биография', 'О человеке']\n",
        "ds = pd.DataFrame(ds)\n",
        "display(ds)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Famq1Jl9dB4s"
      },
      "source": [
        "# **Задание 2**\n",
        "Для удаления пропусков в данных используется функция dropna. После удаления в датасете осталось 153 строки."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "WliOhiIsdBi3",
        "outputId": "b50d903e-c402-42a9-880f-5fb0af544dac"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "  <div id=\"df-a18da0f4-e0c1-4487-a372-99810fc77d0c\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Место</th>\n",
              "      <th>Имя</th>\n",
              "      <th>Возраст</th>\n",
              "      <th>Состояние</th>\n",
              "      <th>Категория</th>\n",
              "      <th>Источник</th>\n",
              "      <th>Страна</th>\n",
              "      <th>Штат</th>\n",
              "      <th>Город</th>\n",
              "      <th>Организация</th>\n",
              "      <th>Selfmade</th>\n",
              "      <th>Пол</th>\n",
              "      <th>Дата рождения</th>\n",
              "      <th>Титул</th>\n",
              "      <th>Оценка благотворительности</th>\n",
              "      <th>Биография</th>\n",
              "      <th>О человеке</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>50.00</td>\n",
              "      <td>219000</td>\n",
              "      <td>Automotive</td>\n",
              "      <td>Tesla, SpaceX</td>\n",
              "      <td>United States</td>\n",
              "      <td>Texas</td>\n",
              "      <td>Austin</td>\n",
              "      <td>Tesla</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>6/28/1971</td>\n",
              "      <td>CEO</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.</td>\n",
              "      <td>Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Jeff Bezos</td>\n",
              "      <td>58.00</td>\n",
              "      <td>171000</td>\n",
              "      <td>Technology</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>United States</td>\n",
              "      <td>Washington</td>\n",
              "      <td>Seattle</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>1/12/1964</td>\n",
              "      <td>Entrepreneur</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.</td>\n",
              "      <td>Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Bill Gates</td>\n",
              "      <td>66.00</td>\n",
              "      <td>129000</td>\n",
              "      <td>Technology</td>\n",
              "      <td>Microsoft</td>\n",
              "      <td>United States</td>\n",
              "      <td>Washington</td>\n",
              "      <td>Medina</td>\n",
              "      <td>Bill &amp; Melinda Gates Foundation</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>10/28/1955</td>\n",
              "      <td>Cofounder</td>\n",
              "      <td>4.00</td>\n",
              "      <td>Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.</td>\n",
              "      <td>When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1643</th>\n",
              "      <td>1579</td>\n",
              "      <td>David Zalik</td>\n",
              "      <td>48.00</td>\n",
              "      <td>1900</td>\n",
              "      <td>Technology</td>\n",
              "      <td>financial technology</td>\n",
              "      <td>United States</td>\n",
              "      <td>Georgia</td>\n",
              "      <td>Atlanta</td>\n",
              "      <td>GreenSky</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>2/2/1974</td>\n",
              "      <td>CEO</td>\n",
              "      <td>3.00</td>\n",
              "      <td>David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.</td>\n",
              "      <td>Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1722</th>\n",
              "      <td>1645</td>\n",
              "      <td>Elaine Wynn</td>\n",
              "      <td>79.00</td>\n",
              "      <td>1800</td>\n",
              "      <td>Gambling &amp; Casinos</td>\n",
              "      <td>casinos, hotels</td>\n",
              "      <td>United States</td>\n",
              "      <td>Nevada</td>\n",
              "      <td>Las Vegas</td>\n",
              "      <td>Wynn Las Vegas, LLC</td>\n",
              "      <td>True</td>\n",
              "      <td>F</td>\n",
              "      <td>4/28/1942</td>\n",
              "      <td>Board Member</td>\n",
              "      <td>3.00</td>\n",
              "      <td>Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.</td>\n",
              "      <td>At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2408</th>\n",
              "      <td>2324</td>\n",
              "      <td>Leonard Schleifer</td>\n",
              "      <td>69.00</td>\n",
              "      <td>1200</td>\n",
              "      <td>Healthcare</td>\n",
              "      <td>pharmaceuticals</td>\n",
              "      <td>United States</td>\n",
              "      <td>New York</td>\n",
              "      <td>Tarrytown</td>\n",
              "      <td>Regeneron Pharmaceuticals</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>7/7/1952</td>\n",
              "      <td>CEO and Founder</td>\n",
              "      <td>2.00</td>\n",
              "      <td>Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.</td>\n",
              "      <td>Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>153 rows × 17 columns</p>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-a18da0f4-e0c1-4487-a372-99810fc77d0c')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-a18da0f4-e0c1-4487-a372-99810fc77d0c button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-a18da0f4-e0c1-4487-a372-99810fc77d0c');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ],
            "text/plain": [
              "      Место                Имя  Возраст  Состояние           Категория  \\\n",
              "0         1          Elon Musk    50.00     219000          Automotive   \n",
              "1         2         Jeff Bezos    58.00     171000          Technology   \n",
              "3         4         Bill Gates    66.00     129000          Technology   \n",
              "...     ...                ...      ...        ...                 ...   \n",
              "1643   1579        David Zalik    48.00       1900          Technology   \n",
              "1722   1645        Elaine Wynn    79.00       1800  Gambling & Casinos   \n",
              "2408   2324  Leonard Schleifer    69.00       1200          Healthcare   \n",
              "\n",
              "                  Источник         Страна        Штат      Город  \\\n",
              "0            Tesla, SpaceX  United States       Texas     Austin   \n",
              "1                   Amazon  United States  Washington    Seattle   \n",
              "3                Microsoft  United States  Washington     Medina   \n",
              "...                    ...            ...         ...        ...   \n",
              "1643  financial technology  United States     Georgia    Atlanta   \n",
              "1722       casinos, hotels  United States      Nevada  Las Vegas   \n",
              "2408       pharmaceuticals  United States    New York  Tarrytown   \n",
              "\n",
              "                          Организация  Selfmade Пол Дата рождения  \\\n",
              "0                               Tesla      True   M     6/28/1971   \n",
              "1                              Amazon      True   M     1/12/1964   \n",
              "3     Bill & Melinda Gates Foundation      True   M    10/28/1955   \n",
              "...                               ...       ...  ..           ...   \n",
              "1643                         GreenSky      True   M      2/2/1974   \n",
              "1722              Wynn Las Vegas, LLC      True   F     4/28/1942   \n",
              "2408        Regeneron Pharmaceuticals      True   M      7/7/1952   \n",
              "\n",
              "                Титул  Оценка благотворительности  \\\n",
              "0                 CEO                        1.00   \n",
              "1        Entrepreneur                        1.00   \n",
              "3           Cofounder                        4.00   \n",
              "...               ...                         ...   \n",
              "1643              CEO                        3.00   \n",
              "1722     Board Member                        3.00   \n",
              "2408  CEO and Founder                        2.00   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Биография  \\\n",
              "0                                                                                                                                                 Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.   \n",
              "1                                                                                                                                        Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.   \n",
              "3     Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.   \n",
              "...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ...   \n",
              "1643                                                                                                                                                                                                                                                                                                                               David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.   \n",
              "1722              Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.    \n",
              "2408                                                                                                                                                                                                                                                                                                                                              Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                            О человеке  \n",
              "0                                                                           Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.   \n",
              "1                                   Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.  \n",
              "3     When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.  \n",
              "...                                                                                                                                                                                                                                                                                                ...  \n",
              "1643                                                                                                        Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.  \n",
              "1722                                                      At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"  \n",
              "2408                                                                                                                                             Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.  \n",
              "\n",
              "[153 rows x 17 columns]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "ds = ds.dropna()\n",
        "display(ds)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "IiHwWCnXeLpE"
      },
      "source": [
        "Кодирование категориальных признаков было сделано с помощью Label Encoder.\n",
        "Данный тип кодирования является наиболее часто используемым, преобразование представляет собой однозначное соответствие число <-> уникальное значение категориального признака. "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "EOYi-Aw4mPu1",
        "outputId": "e42b9cf9-e411-4237-8ff2-9662cee1b02f"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "  <div id=\"df-a3f96fb4-8f10-464e-868d-a9895ba3ab02\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Место</th>\n",
              "      <th>Имя</th>\n",
              "      <th>Возраст</th>\n",
              "      <th>Состояние</th>\n",
              "      <th>Категория</th>\n",
              "      <th>Источник</th>\n",
              "      <th>Страна</th>\n",
              "      <th>Штат</th>\n",
              "      <th>Город</th>\n",
              "      <th>Организация</th>\n",
              "      <th>Selfmade</th>\n",
              "      <th>Пол</th>\n",
              "      <th>Дата рождения</th>\n",
              "      <th>Титул</th>\n",
              "      <th>Оценка благотворительности</th>\n",
              "      <th>Биография</th>\n",
              "      <th>О человеке</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>50.00</td>\n",
              "      <td>219000</td>\n",
              "      <td>0</td>\n",
              "      <td>Tesla, SpaceX</td>\n",
              "      <td>United States</td>\n",
              "      <td>Texas</td>\n",
              "      <td>Austin</td>\n",
              "      <td>Tesla</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>6/28/1971</td>\n",
              "      <td>CEO</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.</td>\n",
              "      <td>Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Jeff Bezos</td>\n",
              "      <td>58.00</td>\n",
              "      <td>171000</td>\n",
              "      <td>15</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>United States</td>\n",
              "      <td>Washington</td>\n",
              "      <td>Seattle</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>1/12/1964</td>\n",
              "      <td>Entrepreneur</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.</td>\n",
              "      <td>Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Bill Gates</td>\n",
              "      <td>66.00</td>\n",
              "      <td>129000</td>\n",
              "      <td>15</td>\n",
              "      <td>Microsoft</td>\n",
              "      <td>United States</td>\n",
              "      <td>Washington</td>\n",
              "      <td>Medina</td>\n",
              "      <td>Bill &amp; Melinda Gates Foundation</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>10/28/1955</td>\n",
              "      <td>Cofounder</td>\n",
              "      <td>4.00</td>\n",
              "      <td>Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.</td>\n",
              "      <td>When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1643</th>\n",
              "      <td>1579</td>\n",
              "      <td>David Zalik</td>\n",
              "      <td>48.00</td>\n",
              "      <td>1900</td>\n",
              "      <td>15</td>\n",
              "      <td>financial technology</td>\n",
              "      <td>United States</td>\n",
              "      <td>Georgia</td>\n",
              "      <td>Atlanta</td>\n",
              "      <td>GreenSky</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>2/2/1974</td>\n",
              "      <td>CEO</td>\n",
              "      <td>3.00</td>\n",
              "      <td>David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.</td>\n",
              "      <td>Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1722</th>\n",
              "      <td>1645</td>\n",
              "      <td>Elaine Wynn</td>\n",
              "      <td>79.00</td>\n",
              "      <td>1800</td>\n",
              "      <td>7</td>\n",
              "      <td>casinos, hotels</td>\n",
              "      <td>United States</td>\n",
              "      <td>Nevada</td>\n",
              "      <td>Las Vegas</td>\n",
              "      <td>Wynn Las Vegas, LLC</td>\n",
              "      <td>True</td>\n",
              "      <td>F</td>\n",
              "      <td>4/28/1942</td>\n",
              "      <td>Board Member</td>\n",
              "      <td>3.00</td>\n",
              "      <td>Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.</td>\n",
              "      <td>At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2408</th>\n",
              "      <td>2324</td>\n",
              "      <td>Leonard Schleifer</td>\n",
              "      <td>69.00</td>\n",
              "      <td>1200</td>\n",
              "      <td>8</td>\n",
              "      <td>pharmaceuticals</td>\n",
              "      <td>United States</td>\n",
              "      <td>New York</td>\n",
              "      <td>Tarrytown</td>\n",
              "      <td>Regeneron Pharmaceuticals</td>\n",
              "      <td>True</td>\n",
              "      <td>M</td>\n",
              "      <td>7/7/1952</td>\n",
              "      <td>CEO and Founder</td>\n",
              "      <td>2.00</td>\n",
              "      <td>Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.</td>\n",
              "      <td>Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>153 rows × 17 columns</p>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-a3f96fb4-8f10-464e-868d-a9895ba3ab02')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-a3f96fb4-8f10-464e-868d-a9895ba3ab02 button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-a3f96fb4-8f10-464e-868d-a9895ba3ab02');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ],
            "text/plain": [
              "      Место                Имя  Возраст  Состояние  Категория  \\\n",
              "0         1          Elon Musk    50.00     219000          0   \n",
              "1         2         Jeff Bezos    58.00     171000         15   \n",
              "3         4         Bill Gates    66.00     129000         15   \n",
              "...     ...                ...      ...        ...        ...   \n",
              "1643   1579        David Zalik    48.00       1900         15   \n",
              "1722   1645        Elaine Wynn    79.00       1800          7   \n",
              "2408   2324  Leonard Schleifer    69.00       1200          8   \n",
              "\n",
              "                  Источник         Страна        Штат      Город  \\\n",
              "0            Tesla, SpaceX  United States       Texas     Austin   \n",
              "1                   Amazon  United States  Washington    Seattle   \n",
              "3                Microsoft  United States  Washington     Medina   \n",
              "...                    ...            ...         ...        ...   \n",
              "1643  financial technology  United States     Georgia    Atlanta   \n",
              "1722       casinos, hotels  United States      Nevada  Las Vegas   \n",
              "2408       pharmaceuticals  United States    New York  Tarrytown   \n",
              "\n",
              "                          Организация  Selfmade Пол Дата рождения  \\\n",
              "0                               Tesla      True   M     6/28/1971   \n",
              "1                              Amazon      True   M     1/12/1964   \n",
              "3     Bill & Melinda Gates Foundation      True   M    10/28/1955   \n",
              "...                               ...       ...  ..           ...   \n",
              "1643                         GreenSky      True   M      2/2/1974   \n",
              "1722              Wynn Las Vegas, LLC      True   F     4/28/1942   \n",
              "2408        Regeneron Pharmaceuticals      True   M      7/7/1952   \n",
              "\n",
              "                Титул  Оценка благотворительности  \\\n",
              "0                 CEO                        1.00   \n",
              "1        Entrepreneur                        1.00   \n",
              "3           Cofounder                        4.00   \n",
              "...               ...                         ...   \n",
              "1643              CEO                        3.00   \n",
              "1722     Board Member                        3.00   \n",
              "2408  CEO and Founder                        2.00   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Биография  \\\n",
              "0                                                                                                                                                 Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.   \n",
              "1                                                                                                                                        Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.   \n",
              "3     Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.   \n",
              "...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ...   \n",
              "1643                                                                                                                                                                                                                                                                                                                               David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.   \n",
              "1722              Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.    \n",
              "2408                                                                                                                                                                                                                                                                                                                                              Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                            О человеке  \n",
              "0                                                                           Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.   \n",
              "1                                   Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.  \n",
              "3     When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.  \n",
              "...                                                                                                                                                                                                                                                                                                ...  \n",
              "1643                                                                                                        Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.  \n",
              "1722                                                      At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"  \n",
              "2408                                                                                                                                             Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.  \n",
              "\n",
              "[153 rows x 17 columns]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "from sklearn.preprocessing import LabelEncoder\n",
        "labelencoder = LabelEncoder()\n",
        "ds['Категория'] = labelencoder.fit_transform(ds['Категория'].values)\n",
        "display(ds)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "yKSaS-1OnkQb"
      },
      "source": [
        "Для просмотра списка закодированных значений используется функция labelencoder.classes_ . Реализация Label Encoder в sklearn прежде всего сортирует по алфавиту уникальные значения, потом присваивает им порядковый номер. Таким образом уникальный номер категориального признака -- это его индекс в данном массиве."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "yaq2SCJTnpYx",
        "outputId": "0a96b5a3-7a38-4846-dc00-31df23cde891"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "array(['Automotive', 'Construction & Engineering', 'Diversified',\n",
              "       'Energy', 'Fashion & Retail', 'Finance & Investments',\n",
              "       'Food & Beverage', 'Gambling & Casinos', 'Healthcare', 'Logistics',\n",
              "       'Manufacturing', 'Media & Entertainment', 'Real Estate', 'Service',\n",
              "       'Sports', 'Technology'], dtype=object)"
            ]
          },
          "execution_count": 12,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "labelencoder.classes_"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BPySH_2UoN5u"
      },
      "source": [
        "Теперь закодируем все категориальные признаки."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "62MVygY3oWcf",
        "outputId": "06a1df12-d7cb-46e7-c3d5-d2f9c1409bca"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "  <div id=\"df-0e1a665d-1b8e-4f09-aa7d-0e2b53a576a0\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Место</th>\n",
              "      <th>Имя</th>\n",
              "      <th>Возраст</th>\n",
              "      <th>Состояние</th>\n",
              "      <th>Категория</th>\n",
              "      <th>Источник</th>\n",
              "      <th>Страна</th>\n",
              "      <th>Штат</th>\n",
              "      <th>Город</th>\n",
              "      <th>Организация</th>\n",
              "      <th>Selfmade</th>\n",
              "      <th>Пол</th>\n",
              "      <th>Дата рождения</th>\n",
              "      <th>Титул</th>\n",
              "      <th>Оценка благотворительности</th>\n",
              "      <th>Биография</th>\n",
              "      <th>О человеке</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>50.00</td>\n",
              "      <td>219000</td>\n",
              "      <td>0</td>\n",
              "      <td>Tesla, SpaceX</td>\n",
              "      <td>0</td>\n",
              "      <td>22</td>\n",
              "      <td>4</td>\n",
              "      <td>Tesla</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>6/28/1971</td>\n",
              "      <td>CEO</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.</td>\n",
              "      <td>Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Jeff Bezos</td>\n",
              "      <td>58.00</td>\n",
              "      <td>171000</td>\n",
              "      <td>15</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>0</td>\n",
              "      <td>24</td>\n",
              "      <td>75</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>1/12/1964</td>\n",
              "      <td>Entrepreneur</td>\n",
              "      <td>1.00</td>\n",
              "      <td>Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.</td>\n",
              "      <td>Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Bill Gates</td>\n",
              "      <td>66.00</td>\n",
              "      <td>129000</td>\n",
              "      <td>15</td>\n",
              "      <td>Microsoft</td>\n",
              "      <td>0</td>\n",
              "      <td>24</td>\n",
              "      <td>50</td>\n",
              "      <td>Bill &amp; Melinda Gates Foundation</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>10/28/1955</td>\n",
              "      <td>Cofounder</td>\n",
              "      <td>4.00</td>\n",
              "      <td>Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.</td>\n",
              "      <td>When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1643</th>\n",
              "      <td>1579</td>\n",
              "      <td>David Zalik</td>\n",
              "      <td>48.00</td>\n",
              "      <td>1900</td>\n",
              "      <td>15</td>\n",
              "      <td>financial technology</td>\n",
              "      <td>0</td>\n",
              "      <td>5</td>\n",
              "      <td>3</td>\n",
              "      <td>GreenSky</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>2/2/1974</td>\n",
              "      <td>CEO</td>\n",
              "      <td>3.00</td>\n",
              "      <td>David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.</td>\n",
              "      <td>Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1722</th>\n",
              "      <td>1645</td>\n",
              "      <td>Elaine Wynn</td>\n",
              "      <td>79.00</td>\n",
              "      <td>1800</td>\n",
              "      <td>7</td>\n",
              "      <td>casinos, hotels</td>\n",
              "      <td>0</td>\n",
              "      <td>13</td>\n",
              "      <td>42</td>\n",
              "      <td>Wynn Las Vegas, LLC</td>\n",
              "      <td>True</td>\n",
              "      <td>0</td>\n",
              "      <td>4/28/1942</td>\n",
              "      <td>Board Member</td>\n",
              "      <td>3.00</td>\n",
              "      <td>Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.</td>\n",
              "      <td>At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2408</th>\n",
              "      <td>2324</td>\n",
              "      <td>Leonard Schleifer</td>\n",
              "      <td>69.00</td>\n",
              "      <td>1200</td>\n",
              "      <td>8</td>\n",
              "      <td>pharmaceuticals</td>\n",
              "      <td>0</td>\n",
              "      <td>15</td>\n",
              "      <td>76</td>\n",
              "      <td>Regeneron Pharmaceuticals</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>7/7/1952</td>\n",
              "      <td>CEO and Founder</td>\n",
              "      <td>2.00</td>\n",
              "      <td>Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.</td>\n",
              "      <td>Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>153 rows × 17 columns</p>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-0e1a665d-1b8e-4f09-aa7d-0e2b53a576a0')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-0e1a665d-1b8e-4f09-aa7d-0e2b53a576a0 button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-0e1a665d-1b8e-4f09-aa7d-0e2b53a576a0');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ],
            "text/plain": [
              "      Место                Имя  Возраст  Состояние  Категория  \\\n",
              "0         1          Elon Musk    50.00     219000          0   \n",
              "1         2         Jeff Bezos    58.00     171000         15   \n",
              "3         4         Bill Gates    66.00     129000         15   \n",
              "...     ...                ...      ...        ...        ...   \n",
              "1643   1579        David Zalik    48.00       1900         15   \n",
              "1722   1645        Elaine Wynn    79.00       1800          7   \n",
              "2408   2324  Leonard Schleifer    69.00       1200          8   \n",
              "\n",
              "                  Источник  Страна  Штат  Город  \\\n",
              "0            Tesla, SpaceX       0    22      4   \n",
              "1                   Amazon       0    24     75   \n",
              "3                Microsoft       0    24     50   \n",
              "...                    ...     ...   ...    ...   \n",
              "1643  financial technology       0     5      3   \n",
              "1722       casinos, hotels       0    13     42   \n",
              "2408       pharmaceuticals       0    15     76   \n",
              "\n",
              "                          Организация  Selfmade  Пол Дата рождения  \\\n",
              "0                               Tesla      True    1     6/28/1971   \n",
              "1                              Amazon      True    1     1/12/1964   \n",
              "3     Bill & Melinda Gates Foundation      True    1    10/28/1955   \n",
              "...                               ...       ...  ...           ...   \n",
              "1643                         GreenSky      True    1      2/2/1974   \n",
              "1722              Wynn Las Vegas, LLC      True    0     4/28/1942   \n",
              "2408        Regeneron Pharmaceuticals      True    1      7/7/1952   \n",
              "\n",
              "                Титул  Оценка благотворительности  \\\n",
              "0                 CEO                        1.00   \n",
              "1        Entrepreneur                        1.00   \n",
              "3           Cofounder                        4.00   \n",
              "...               ...                         ...   \n",
              "1643              CEO                        3.00   \n",
              "1722     Board Member                        3.00   \n",
              "2408  CEO and Founder                        2.00   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Биография  \\\n",
              "0                                                                                                                                                 Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.   \n",
              "1                                                                                                                                        Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.   \n",
              "3     Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.   \n",
              "...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ...   \n",
              "1643                                                                                                                                                                                                                                                                                                                               David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.   \n",
              "1722              Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.    \n",
              "2408                                                                                                                                                                                                                                                                                                                                              Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                            О человеке  \n",
              "0                                                                           Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.   \n",
              "1                                   Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.  \n",
              "3     When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.  \n",
              "...                                                                                                                                                                                                                                                                                                ...  \n",
              "1643                                                                                                        Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.  \n",
              "1722                                                      At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"  \n",
              "2408                                                                                                                                             Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.  \n",
              "\n",
              "[153 rows x 17 columns]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "ds['Страна'] = labelencoder.fit_transform(ds['Страна'].values)\n",
        "ds['Штат'] = labelencoder.fit_transform(ds['Штат'].values)\n",
        "ds['Город'] = labelencoder.fit_transform(ds['Город'].values)\n",
        "ds['Пол'] = labelencoder.fit_transform(ds['Пол'].values)\n",
        "display(ds)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "V-MU1WlAoxes"
      },
      "source": [
        "При нормализации меняем масштаб данных. Чаще всего масштабирование данных изменяется в диапазоне от 0 до 1. "
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 33,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "woNyuKNfqMK8",
        "outputId": "015ee3b8-d547-4c8e-81ba-e6e7871a5246"
      },
      "outputs": [
        {
          "data": {
            "text/html": [
              "\n",
              "  <div id=\"df-ec2947eb-c541-42fb-b110-c7989ea2f205\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Место</th>\n",
              "      <th>Имя</th>\n",
              "      <th>Возраст</th>\n",
              "      <th>Состояние</th>\n",
              "      <th>Категория</th>\n",
              "      <th>Источник</th>\n",
              "      <th>Страна</th>\n",
              "      <th>Штат</th>\n",
              "      <th>Город</th>\n",
              "      <th>Организация</th>\n",
              "      <th>Selfmade</th>\n",
              "      <th>Пол</th>\n",
              "      <th>Дата рождения</th>\n",
              "      <th>Титул</th>\n",
              "      <th>Оценка благотворительности</th>\n",
              "      <th>Биография</th>\n",
              "      <th>О человеке</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>50.00</td>\n",
              "      <td>0.49</td>\n",
              "      <td>0</td>\n",
              "      <td>Tesla, SpaceX</td>\n",
              "      <td>0</td>\n",
              "      <td>22</td>\n",
              "      <td>4</td>\n",
              "      <td>Tesla</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>6/28/1971</td>\n",
              "      <td>CEO</td>\n",
              "      <td>0.04</td>\n",
              "      <td>Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.</td>\n",
              "      <td>Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "      <td>Jeff Bezos</td>\n",
              "      <td>58.00</td>\n",
              "      <td>0.39</td>\n",
              "      <td>15</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>0</td>\n",
              "      <td>24</td>\n",
              "      <td>75</td>\n",
              "      <td>Amazon</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>1/12/1964</td>\n",
              "      <td>Entrepreneur</td>\n",
              "      <td>0.04</td>\n",
              "      <td>Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.</td>\n",
              "      <td>Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "      <td>Bill Gates</td>\n",
              "      <td>66.00</td>\n",
              "      <td>0.29</td>\n",
              "      <td>15</td>\n",
              "      <td>Microsoft</td>\n",
              "      <td>0</td>\n",
              "      <td>24</td>\n",
              "      <td>50</td>\n",
              "      <td>Bill &amp; Melinda Gates Foundation</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>10/28/1955</td>\n",
              "      <td>Cofounder</td>\n",
              "      <td>0.14</td>\n",
              "      <td>Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.</td>\n",
              "      <td>When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1643</th>\n",
              "      <td>1579</td>\n",
              "      <td>David Zalik</td>\n",
              "      <td>48.00</td>\n",
              "      <td>0.00</td>\n",
              "      <td>15</td>\n",
              "      <td>financial technology</td>\n",
              "      <td>0</td>\n",
              "      <td>5</td>\n",
              "      <td>3</td>\n",
              "      <td>GreenSky</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>2/2/1974</td>\n",
              "      <td>CEO</td>\n",
              "      <td>0.11</td>\n",
              "      <td>David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.</td>\n",
              "      <td>Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1722</th>\n",
              "      <td>1645</td>\n",
              "      <td>Elaine Wynn</td>\n",
              "      <td>79.00</td>\n",
              "      <td>0.00</td>\n",
              "      <td>7</td>\n",
              "      <td>casinos, hotels</td>\n",
              "      <td>0</td>\n",
              "      <td>13</td>\n",
              "      <td>42</td>\n",
              "      <td>Wynn Las Vegas, LLC</td>\n",
              "      <td>True</td>\n",
              "      <td>0</td>\n",
              "      <td>4/28/1942</td>\n",
              "      <td>Board Member</td>\n",
              "      <td>0.11</td>\n",
              "      <td>Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.</td>\n",
              "      <td>At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2408</th>\n",
              "      <td>2324</td>\n",
              "      <td>Leonard Schleifer</td>\n",
              "      <td>69.00</td>\n",
              "      <td>0.00</td>\n",
              "      <td>8</td>\n",
              "      <td>pharmaceuticals</td>\n",
              "      <td>0</td>\n",
              "      <td>15</td>\n",
              "      <td>76</td>\n",
              "      <td>Regeneron Pharmaceuticals</td>\n",
              "      <td>True</td>\n",
              "      <td>1</td>\n",
              "      <td>7/7/1952</td>\n",
              "      <td>CEO and Founder</td>\n",
              "      <td>0.07</td>\n",
              "      <td>Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.</td>\n",
              "      <td>Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>153 rows × 17 columns</p>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-ec2947eb-c541-42fb-b110-c7989ea2f205')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-ec2947eb-c541-42fb-b110-c7989ea2f205 button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-ec2947eb-c541-42fb-b110-c7989ea2f205');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ],
            "text/plain": [
              "      Место                Имя  Возраст  Состояние  Категория  \\\n",
              "0         1          Elon Musk    50.00       0.49          0   \n",
              "1         2         Jeff Bezos    58.00       0.39         15   \n",
              "3         4         Bill Gates    66.00       0.29         15   \n",
              "...     ...                ...      ...        ...        ...   \n",
              "1643   1579        David Zalik    48.00       0.00         15   \n",
              "1722   1645        Elaine Wynn    79.00       0.00          7   \n",
              "2408   2324  Leonard Schleifer    69.00       0.00          8   \n",
              "\n",
              "                  Источник  Страна  Штат  Город  \\\n",
              "0            Tesla, SpaceX       0    22      4   \n",
              "1                   Amazon       0    24     75   \n",
              "3                Microsoft       0    24     50   \n",
              "...                    ...     ...   ...    ...   \n",
              "1643  financial technology       0     5      3   \n",
              "1722       casinos, hotels       0    13     42   \n",
              "2408       pharmaceuticals       0    15     76   \n",
              "\n",
              "                          Организация  Selfmade  Пол Дата рождения  \\\n",
              "0                               Tesla      True    1     6/28/1971   \n",
              "1                              Amazon      True    1     1/12/1964   \n",
              "3     Bill & Melinda Gates Foundation      True    1    10/28/1955   \n",
              "...                               ...       ...  ...           ...   \n",
              "1643                         GreenSky      True    1      2/2/1974   \n",
              "1722              Wynn Las Vegas, LLC      True    0     4/28/1942   \n",
              "2408        Regeneron Pharmaceuticals      True    1      7/7/1952   \n",
              "\n",
              "                Титул  Оценка благотворительности  \\\n",
              "0                 CEO                        0.04   \n",
              "1        Entrepreneur                        0.04   \n",
              "3           Cofounder                        0.14   \n",
              "...               ...                         ...   \n",
              "1643              CEO                        0.11   \n",
              "1722     Board Member                        0.11   \n",
              "2408  CEO and Founder                        0.07   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Биография  \\\n",
              "0                                                                                                                                                 Elon Musk is working to revolutionize transportation both on Earth, through electric car maker Tesla -- and in space, via rocket producer SpaceX.\\nHe owns 21% of Tesla but has pledged more than half his stake as collateral for loans; Forbes has discounted his stake to take the loans into account.\\nA regulatory filing in early April 2022 revealed that Musk had purchased 9.2% of Twitter. The company invited him to join its board the next day.  \\nSpaceX, Musk's rocket company, is valued at $74 billion after a funding round in February 2021.\\nHe grew up in South Africa, then immigrated to Canada at age 17. He landed in the U.S. as a transfer student to the University of Pennsylvania.   \n",
              "1                                                                                                                                        Jeff Bezos founded e-commerce giant Amazon in 1994 out of his garage in Seattle. He stepped down as CEO to become executive chairman in July 2021.\\nBezos sold $8.8 billion worth of his Amazon stock in 2021 and also gave some shares away; he now owns a bit less than 10% of the company. \\nAmazon faced criticism from U.S. senators and the general public for its treatment of warehouse workers during the coronavirus pandemic.\\nHe and his wife MacKenzie divorced in 2019 after 25 years of marriage and he transferred a quarter of his then-16% Amazon stake to her.\\nBezos owns The Washington Post and Blue Origin, an aerospace company developing rockets; he briefly flew to space in one in July 2021.   \n",
              "3     Bill Gates turned his fortune from software firm Microsoft into a diversified fortune including investments zero-carbon energy.\\nIn May 2021, Bill and Melinda each announced on Twitter they were ending their marriage after 27 years. They still co-chair the charitable Gates Foundation.\\nGates, who cofounded Microsoft with Paul Allen (d. 2018) in 1975, has transferred at least $5.7 billion worth of shares in public companies to Melinda.\\nAs of March 2020, when Gates stepped down from the Microsoft board, he owned about 1% of the software and computing company's shares. \\nHe has invested in dozens of companies including Canadian National Railway and AutoNation, and is one of the largest owners of farmland in the U.S.\\nTo date, Gates has donated an estimated $35.8 billion worth of Microsoft stock to the Gates Foundation.   \n",
              "...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ...   \n",
              "1643                                                                                                                                                                                                                                                                                                                               David Zalik is the cofounder and CEO of financial technology company GreenSky.\\nThe Atlanta-based company has facilitated $16 billion in loans for home improvement projects via a network of banks and 13,000 contractors.\\nGreenSky has also begun to branch into financing for doctor, dentist and veterinary visits.\\nZalik took the $415 million (sales) company public in May 2018.\\nHe immigrated to the U.S. from Israel at age four when his father, a mathematics professor, got a job at University of Rhode Island.   \n",
              "1722              Dubbed the \"Queen of Las Vegas,\" Elaine Wynn became the largest shareholder of publicly traded Wynn Resorts in March 2018.\\r\\n\\nHer ex-husband Steve Wynn stepped down as CEO amid sexual misconduct allegations, which he denied; he sold all his shares in March 2018.\\nIn May 2018, Elaine Wynn launched a proxy battle and successfully forced the resignations of two longtime board members who were Steve loyalists.\\nAfter marrying Steve during her third year of college, Wynn worked Sundays at his father's Maryland bingo hall before the couple moved to Las Vegas.\\nThey launched Mirage Resorts in 1973 and went on to cofound Wynn Resorts in 2002. Elaine Wynn served as a board member for 13 years until 2015.\\nAs co-chair of LACMA, she pledged a $50 million donation in 2016 to build a new permanent collection space.    \n",
              "2408                                                                                                                                                                                                                                                                                                                                              Leonard Schleifer cofounded drugmaker Regeneron in 1988, and remains CEO of the Tarrytown, New York company.\\nSchleifer took Regeneron public in 1991; he owns nearly 4% of the company's common stock.\\nSales of Regeneron's blockbuster drug Eylea, a treatment for macular degeneration, reached $4.6 billion in the U.S. in 2019.\\nRegeneron has developed six FDA-approved medicines. \\nIn June 2020, Regeneron began clinical trials of a new antibody medicine to prevent and treat people with Covid-19.   \n",
              "\n",
              "                                                                                                                                                                                                                                                                                            О человеке  \n",
              "0                                                                           Musk was accepted to a graduate program at Stanford, but deferred attendance to launch his first business, software company Zip2.\\nAs a kid Musk taught himself to code; he sold his first game, Blastar, for about $500.   \n",
              "1                                   Growing up, Jeff Bezos worked summers on his grandfather's ranch repairing Caterpillar tractors.\\nBezos met Google founders Larry Page and Sergey Brin in 1998 and managed to become one of the company's first angel investors, putting in an estimated $250,000.  \n",
              "3     When Gates was a kid, he spent so much time reading that his parents finally forbade him from bringing books to the dinner table.\\nGates took a break from classes his senior year in high school to do programming with his friend Paul Allen at a power plant in North Bonneville, Washington.  \n",
              "...                                                                                                                                                                                                                                                                                                ...  \n",
              "1643                                                                                                        Zalik started his first business at the age of 14, buying computer parts from distributors and assembling them himself.\\nZalik didn't attend high school and never graduated from college.  \n",
              "1722                                                      At the Bellagio, which the Wynns opened in 1998, she commissioned the hotel's iconic glass installation by artist Dale Chihuly.\\nAn avid art collector, she paid $142.4 million in 2013 for Francis Bacon's \"Three Studies of Lucian Freud.\"  \n",
              "2408                                                                                                                                             Schleifer attended Cornell on scholarship and dreamed of a medical career.\\nThe son of a sweater manufacturer, Schleifer grew up in Queens, New York.  \n",
              "\n",
              "[153 rows x 17 columns]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "from sklearn.datasets import load_iris\n",
        "from sklearn import preprocessing\n",
        "x_array = np.array(ds['Оценка благотворительности'])\n",
        "normalized_arr = preprocessing.normalize([x_array])\n",
        "ds['Оценка благотворительности'] = normalized_arr[0]\n",
        "\n",
        "\n",
        "x_array = np.array(ds['Состояние'])\n",
        "normalized_arr = preprocessing.normalize([x_array])\n",
        "ds['Состояние'] = normalized_arr[0]\n",
        "display(ds)"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
